Lock
TheLock
method locks this link-source object, ensuring exclusive access to its content storage unit.
ODBoolean Lock (in ODULong wait, out ODLinkKey key);
wait
- The time interval to wait for access to be granted.
key
- If access is granted, a valid link key; otherwise an undefined, invalid key.
- return value
kODTrue
if access is granted, otherwisekODFalse
.DISCUSSION
To ensure thread-safe access, you must call this method to acquire a valid link key before you write the link data. This method grants exclusive access to this link-source object's content; nested calls to theLock
method deny access.The
wait
parameter specifies the time you are willing to wait for access to be granted. A value of 0 means no wait and is the only value accepted on the Mac OS platform. If thewait
argument is nonzero and the lock cannot be granted, theLock
method returnskODFalse
immediately. Other platforms may accept other values with platform-dependent meanings.While your part has this link-source object locked, you must pass the key returned in the
key
output parameter to all methods that access or modify this link-source object, such as theClear
,ContentUpdated
, andGetContentStorageUnit
methods. When you are finished modifying this link-source object, you must pass the key to theUnlock
method to unlock the link-source object.EXCEPTIONS
kODErrBrokenLink
- Internal error; this link-source object disconnected from its destinations.
SEE ALSO
TheODLinkKey
type (page 924).
TheODLinkSource::Clear
method (page 376).
TheODLinkSource::ContentUpdated
method (page 378).
TheODLinkSource::GetContentStorageUnit
method (page 380).
TheODLinkSource::Unlock
method (page 388).
"Manipulating Links" on page 380 in OpenDoc Programmer's Guide.
"Updating a Link at the Source" on page 386 in OpenDoc Programmer's Guide.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help